package cn.tedu.m1;

import org.springframework.amqp.core.Queue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

import javax.annotation.PostConstruct;

@SpringBootApplication
public class Main {
    @Autowired
    private Prodicer p;

    public static void main(String[] args) {
        SpringApplication.run(Main.class, args);
    }
    //当springboot完整启动并所有注入完成时执行
    @PostConstruct
    public void test(){
        p.send();
    }

    @Bean
    public Queue taskQueue(){
        return new Queue("helloword", false);
    }
}

